package com.cuit.qx.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cuit.qx.bean.Message;
import com.cuit.qx.dao.MessageMapper;
import com.cuit.qx.service.MessageService;

@Service
public class MessageServiceImpl implements MessageService{
	
	@Autowired
	private MessageMapper messageMapper;

	@Override
	public int insertMessage(Message message) {
		int insertMessage = messageMapper.insertMessage(message);
		return insertMessage;
	}

	@Override
	public int getCountMessage(String username) {
		int insertMessage = messageMapper.getCountMessage(username);
		return insertMessage;
	}

	@Override
	public List<Message> getList() {
		List<Message> list=messageMapper.getListAll();
		return list;
	}

	@Override
	public int deleteMessage(String id) {
		int delete = messageMapper.deleteMessage(id);
		return delete;
	}

	@Override
	public int updateMessage(Message message) {
		int update = messageMapper.updateMessage(message);
		return update;
	}

	@Override
	public List<Message> getNewList(String username) {
		List<Message> list=messageMapper.getNewList(username);
		return list;
	}

	@Override
	public int confirmMessage(String id, String username) {
		int confirm = messageMapper.confirmMessage(id,username);
		return confirm;
	}
	
	
	
	

}
